package com.gulimall.auth.controller;

import com.guli.common.utils.R;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @ClassName ExceptionController
 * @Author Hao_YunKai
 * @Date 2022/2/9 15:58
 */
@ControllerAdvice
public class ExceptionController {

    @ExceptionHandler
    @ResponseBody
    public R exception(Exception e) {
        e.printStackTrace();
        return R.error(400,"有异常了，需要处理在controller服务");
    }
}
